#!/usr/bin/env python3
import os

from argparse import ArgumentParser


if __name__ == '__main__':
    parser = ArgumentParser()
    parser.add_argument('-i', '--input', type=str, required=True,
                        help='Input directory')
    parser.add_argument('-p', '--pages', type=int, required=True,
                        help='Expected count of pages')
    args = parser.parse_args()

    ids = {}
    files = os.listdir(args.input)
    for file in files:
        if not file.endswith('.pdf'):
            continue

        id = file[0:file.index('.')]
        if not id.isnumeric():
            continue

        id = int(id)
        if id not in ids:
            ids[id] = 1

    for i in range(1, args.pages):
        if i not in ids:
            print(f'missing {i}')
